﻿var path = "/monitor/oper/log";

layui.use(['table', 'laypage'], function () {
    table = layui.table;
    layPage = layui.laypage;

    /* 初始化表格 */
    initTable();

    // 搜索
    $.searchTable.searchBtn();

    //监听行工具事件
    table.on('tool(operLogLay)', function (obj) {
        let data = obj.data;
        if ('see' === obj.event) {
            let seeUrl = path + '/see/' + data.id;
            $.modal.see('查看', seeUrl, '700', '700');
        }
    });

});

/* 加载表格 */
function initTable() {
    let name = $("#name").val();
    let status = $("#status").val();
    let businessType = $("#businessType").val();
    $.table.init({
        url: path + "/page",
        where: {
            title: name,
            status: status,
            businessType: businessType
        },
        cols: [[
            {field: 'title', title: '模块标题', align: "center"},
            {field: 'businessType', title: '业务类型', align: "center"},
            {field: 'status', title: '操作状态', align: "center"},
            {field: 'createUser', title: '操作人员', align: "center"},
            {field: 'operIp', title: '主机地址', align: "center"},
            {field: 'createTime', title: '操作时间', align: "center"},
            {fixed: 'right', title: '操作', toolbar: '#toolbarHandle', width: 120, align: "center"}
        ]],
    });
}
